feat: partial-shift content handover (server)#1477
Merged
Conversation
Workers with multiple planned shifts on a date can now hand over any
subset independently instead of the whole day. Recipients accept or
reject each shift on its own.
- Proto: repeated shift_indices on Create + eligibility; shift_index on
request model. CreateContentHandover response keeps singular shape
(backwards-compatible) and adds a repeated models field.
- Service: per-shift validation, atomic all-or-nothing create, partial
MoveContent that touches only the selected Shift{N} columns and
recomputes PlanHours via CalculatePauseAutoBreakCalculationActive.
Duplicate-pending matrix blocks full-day↔partial overlap.
- Eligibility: when shift_indices is non-empty, coworkers must have
PlannedEndOfShift{N} == 0 for every listed N.
- Push: batched create notification carries handoverRequestId (first)
and handoverRequestIds (CSV) for dual-key compatibility.
- Tests: single/multi-shift create, atomic rollback, accept one of N,
accept-all-equivalence, reject one of N, duplicate-pending matrix,
eligibility filter.
- Bumps Microting.TimePlanningBase to 10.0.37 (adds ShiftIndex column).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AcceptAsync hard-fails on the partial path when no AssignedSite exists for source/target (safety net against silent derived-field corruption). The new partial-shift tests did not seed these rows, so CI failed with "AssignedSite missing for source worker". Seed both sites in the shared SeedPartialShiftPairAsync helper. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
repeated shift_indicesto Create + eligibility andshift_indexon the request model.CreateContentHandoverkeeps the singularContentHandoverResponseshape plus a newrepeated modelsfield for wire-compat with older clients.MoveContenttouches onlyPlannedStart/End/Break{N}and recomputesPlanHours/IsDoubleShiftviaCalculatePauseAutoBreakCalculationActive. Duplicate-pending matrix blocks full-day↔partial overlap.handoverRequestId(first id, singular — matches mobile FCM handler) andhandoverRequestIds(CSV) for future batch-aware clients.Microting.TimePlanningBaseto 10.0.37 which adds theShiftIndexcolumn.Test plan
.NET Build & Test.tool/probe_plannings.dartafter Flutter client lands: login as gps@microting.com on 855, partial-handover 2 of 5 shifts to a coworker, accept one + reject other, verify planning state on both workers.Follow-up (not in this PR)
docs/purring-strolling-whistle-design.mdstyle plan.🤖 Generated with Claude Code